Reading Logical Groups of Data from Physical Locations in Memory Using Headers

ABSTRACT

The various implementations described herein include systems, methods and/or devices for reading data stored in a storage device. In one aspect, read commands are executed, each command for reading a requested logical group of data from a specified logical address comprising one or more logical portions. A first physical location in the storage device corresponding to the logical address is identified from a mapping table, and data is read. In accordance with a determination that the first physical location stores less than all of the logical group of data, a second physical location is identified based on information contained within the data from the first physical location, and data is read from the second physical location. Data read from the one or more physical locations is decoded to produce the requested logical group of data, which is then returned.

RELATED APPLICATIONS

This application claims priority to U.S. Provisional Patent ApplicationNo. 62/262,753, filed Dec. 3, 2015, which is hereby incorporated byreference in its entirety.

This application is related to U.S. patent application Ser. No.14/929,148, “Device-Specific Variable Error Correction,” filed on Oct.30, 2015; U.S. patent application Ser. No. 14/885,883, “Method forModifying Device-Specific Variable Error Correction Settings,” filed onOct. 16, 2015; U.S. patent application Ser. No. 14/883,547, “MappingLogical Groups of Data to Physical Locations in Memory,” filed on Oct.14, 2015; U.S. Provisional Patent Application No. 62/144,839,“Device-Specific Variable Error Correction,” filed Apr. 8, 2015; U.S.Provisional Patent Application No. 62/144,844, “Method for ModifyingDevice-Specific Variable Error Correction Settings,” filed on Apr. 8,2015; and U.S. Provisional Patent Application No. 62/144,847, “MappingLogical Groups of Data to Physical Locations in Memory,” filed on Apr.8, 2015; all of which are hereby incorporated by reference in theirentireties.

TECHNICAL FIELD

The disclosed embodiments relate generally to memory systems, and inparticular, to reading data from and storing data in a storage deviceusing headers.

BACKGROUND

Non-volatile memories, such as flash memory devices, have supported theincreased portability of consumer electronics, and have been utilized inrelatively low power enterprise storage systems suitable for cloudcomputing and mass storage. The ever-present demand for almost continualadvancement in these areas is often accompanied by demand to improvedata storage capacity. The demand for greater storage capacity in turnstokes demand for greater storage density, so that specifications suchas power consumption and form factor may be maintained and preferablyreduced. As such, there is ongoing pressure to increase the storagedensity of non-volatile memories in order to further improve the usefulattributes of such devices. However, a drawback of increasing storagedensity is that the stored data is increasingly prone to storage and/orreading errors.

Error correction schemes have been used to limit the increasedlikelihood of errors in memory systems. However, error correctionschemes, particularly those with high error correction capability, areoften resource intensive and not configured for optimal systemperformance. In turn, the implementation of improved error correctionschemes demands that read and write operations adapt accordingly inorder to achieve efficient system performance.

SUMMARY

Various implementations of systems, methods and devices within the scopeof the appended claims each have several aspects, no single one of whichis solely responsible for the attributes described herein. Withoutlimiting the scope of the appended claims, after considering thisdisclosure, and particularly after considering the section entitled“Detailed Description” one will understand how the aspects of variousimplementations are used to enable: (i) reading data stored in anon-volatile storage device having a plurality of physical memoryportions having a predefined sequence of physical locations in one ormore non-volatile memory devices, and (ii) storing data in anon-volatile storage device having a plurality of physical memoryportions having a predefined sequence of physical locations in one ormore non-volatile memory devices.

In one aspect, a plurality of read commands is executed, each commandfor reading, from a specified logical address, a requested logical groupof data comprising one or more logical portions. For each read command,a first physical location in the storage device corresponding to thelogical address specified by the read command is identified from amapping table, and data is read from the first physical location. Inaccordance with a determination that the first physical location in thestorage device stores less than all of the logical group of datarequested by the read command (e.g., part of the logical group of datais stored elsewhere, but the first physical location had insufficientcapacity store the entire logical group of data), a second physicallocation in the storage device is identified based on informationcontained within the data read from the first physical location, anddata is read from the second physical location. Furthermore, at leastrespective portions of the data read from the first physical locationand/or the second physical location in the storage device are decoded toproduce the requested logical group of data. For each read command inthe plurality of read commands, the requested logical group of data isthen returned.

In another aspect, a plurality of commands is executed, each command forstoring in a storage device a logical group of data comprising one ormore logical portions and having a logical address. For each command, inaccordance with a determination that a remaining capacity of a firstphysical memory portion is less than a threshold capacity, data isstored for a head logical portion in a first physical locationcorresponding to the first physical memory portion. Furthermore, data isstored for a tail logical portion in a second physical locationcorresponding to a second physical memory portion. Mapping entries arestored in a mapping table, where the mapping entries map thecorresponding logical address to at least the first physical location inthe storage device.

BRIEF DESCRIPTION OF THE DRAWINGS

So that the present disclosure can be understood in greater detail, amore particular description may be had by reference to the features ofvarious implementations, some of which are illustrated in the appendeddrawings. The appended drawings, however, merely illustrate the morepertinent features of the present disclosure and are therefore not to beconsidered limiting, for the description may admit to other effectivefeatures.

FIG. 1 is a block diagram illustrating an implementation of a datastorage system, in accordance with some embodiments.

FIG. 2 is a block diagram illustrating an implementation of a managementmodule, in accordance with some embodiments.

FIG. 3 illustrates codewords produced in accordance with various errorcorrection formats, in accordance with some embodiments.

FIGS. 4A-4B represent physical and logical views of data in a storagedevice, in accordance with some embodiments.

FIGS. 5A-5E illustrates a flowchart representation of a method forreading data stored in a non-volatile memory device, in accordance withsome embodiments.

In accordance with common practice the various features illustrated inthe drawings may not be drawn to scale. Accordingly, the dimensions ofthe various features may be arbitrarily expanded or reduced for clarity.In addition, some of the drawings may not depict all of the componentsof a given system, method or device. Finally, like reference numeralsmay be used to denote like features throughout the specification andfigures.

DETAILED DESCRIPTION

The various implementations described herein include systems, methodsand/or devices used to enable: (i) reading data stored in a non-volatilestorage device having a plurality of physical memory portions having apredefined sequence of physical locations in one or more non-volatilememory devices, and (ii) storing data in a non-volatile storage devicehaving a plurality of physical memory portions having a predefinedsequence of physical locations in one or more non-volatile memorydevices.

(A1) More specifically, some implementations include a method of readingdata stored in a non-volatile storage device having a plurality ofphysical memory portions having a predefined sequence of physicallocations in one or more non-volatile memory (NVM) devices of thestorage device. In some implementations, the method includes executing aplurality of read commands, each read command of the plurality of readcommands for reading a requested logical group of data from a specifiedlogical address, the requested logical group of data comprising one ormore logical portions. For each read command of the plurality of readcommands, a first physical location in the storage device correspondingto the logical address specified by the read command is identified froma mapping table, and data is read from the first physical location. Inaccordance with a determination that the first physical location in thestorage device stores less than all of the logical group of datarequested by the read command, a second physical location in the storagedevice is identified based on information contained within the data readfrom the first physical location, and data is read from the secondphysical location. At least respective portions of the data read fromthe first physical location and/or the second physical location in thestorage device are decoded to produce the requested logical group ofdata, and the requested logical group of data is returned.

(A2) In some embodiments of the method of A1, the first physicallocation corresponds to data for a head logical portion of the one ormore logical portions of the requested logical group of data, andcorresponds to a first physical memory portion of the plurality ofphysical memory portions. Furthermore, the second physical locationcorresponds to data for a tail logical portion of the one or morelogical portions of the requested logical group of data, and correspondsto a second physical memory portion of the plurality of physical memoryportions, wherein the second physical memory portion is distinct fromthe first physical memory portion. Reading data from the first physicallocation includes reading data from the first physical memory portion,and reading data from the second physical location includes reading datafrom the second physical memory portion.

(A3) In some embodiments of the method of A2, the first physical memoryportion is a first physical page of the storage device, and the secondphysical memory portion is a second physical page of the storage device.

(A4) In some embodiments of the method of any of A2-A3, the firstphysical memory portion is a physical memory portion of a first die, andthe second physical memory portion is a physical memory portion of asecond die, distinct from the first die.

(A5) In some embodiments of the method of any of A2-A3, the firstphysical memory portion and the second physical memory portion arephysical memory portions of the same die.

(A6) In some embodiments of the method of any of A2-A5, each of theplurality of physical memory portions comprises a respective integernumber of codewords arranged in a respective sequence. The firstphysical location corresponds to a subset of codewords, of respectivecodewords for the first physical memory portion, located at the end ofthe respective sequence, and the second physical location corresponds toa subset of codewords, of respective codewords for the second physicalmemory portion, located at the end of the respective sequence.

(A7) In some embodiments of the method of A6, the subset of codewordscorresponding to the first physical location and the subset of codewordscorresponding to the second physical location each comprise a singlecodeword.

(A8) In some embodiments of the method of any of A6-A7, the subset ofcodewords corresponding to the second physical location includes encodeddata for a portion of the requested logical group of data and encodeddata for a portion of a distinct logical group of data.

(A9) In some embodiments of the method of A8, the encoded data for theportion of the distinct logical group of data corresponds to a headlogical portion for the distinct logical group of data.

(A10) In some embodiments of the method of any of A1-A9, the methodincludes determining whether the first physical location stores lessthan all of the requested logical group of data by reading acorresponding entry of the mapping table for the requested logical groupof data, the corresponding entry indicating whether the first physicallocation stores less than all of the requested logical group of data.

(A11) In some embodiments of the method of A10, the corresponding entryincludes a flag indicating whether the first physical location includesinformation specifying the second physical location.

(A12) In some embodiments of the method of any of A10-A11, thecorresponding entry specifies the first and second physical locationscorresponding to data for the one or more logical portions of therequested logical group of data, wherein the first and second physicallocations correspond to distinct physical memory portions of theplurality of physical memory portions of the storage device.

(A13) In some embodiments of the method of any of A10-A12, thecorresponding entry specifies a respective physical location at whichthe information specifying the second physical location is stored.

(A14) In some embodiments of the method of any of A1-A13, the methodincludes determining that the first physical location stores less thanall of the requested logical group of data by decoding at least aportion of the data read from the first physical location, wherein thedecoded data includes the information specifying the second physicallocation in the storage device.

(A15) In some embodiments of the method of any of A1-A14, the data readfrom the first physical location includes one or more codewordscorresponding to encoded data for a portion of requested logical groupof data, and further includes data corresponding to the informationspecifying the second physical location. The method further includesdetermining that the first physical location stores less than all of therequested logical group of data by reading the data corresponding to theinformation specifying the second physical location.

(A16) In some embodiments of the method of any of A1-A15, the methodincludes determining whether the first physical location stores lessthan all of the requested logical group of data by decoding at least aportion of the data read from the first physical location, and bycomparing the size of the decoded data to the size of the requestedlogical group of data, wherein the first physical location stores lessthan all of the requested logical group of data if the size of thedecoded data is less than the size of the requested logical group ofdata.

(A17) In some embodiments of the method of any of A1-A16, the firstphysical location corresponds to data for a head logical portion of theone or more logical portions, and the second physical locationcorresponds to data for a tail logical portion of the one or morelogical portions. Furthermore, the information contained within the dataread from the first physical location is stored in a header segment thatspecifies: the first physical location for the head logical portion andthe second physical location for the tail logical portion; a check valuefor the logical group of data for verifying the first and/or secondphysical location for the tail logical portion; and/or additional paritybits for error correcting decoded data for the logical group of data.

(A18) In some embodiments of the method of any of A1-A17, the data readfrom the first physical location and the data read from the secondphysical location comprise respective sets of one or more codewords.Furthermore, the decoding includes determining, for each of therespective sets of one or more codewords, a respective error correctionformat based on the respective physical location to which the respectiveset of one or more codewords corresponds; and decoding each of therespective sets of codewords using the determined respective errorcorrection format to produce the requested logical group of data.

(A19) In another aspect, any of the methods A1-A18 described above areperformed by a data storage device or system comprising one or more NVMdevices, wherein a plurality of physical memory portions of the storagedevice has a predefined sequence of physical locations in the one ormore NVM devices. The storage device or system further includes a memorycontroller that includes a management module, and also includes aninterface to receive a plurality of read commands, each read command ofthe plurality of read commands for reading a requested logical group ofdata from a specified logical address, the requested logical group ofdata comprising one or more logical portions. Furthermore, themanagement module is configured to identify, from a mapping table, afirst physical location in the storage device corresponding to thespecified logical addresses. In accordance with a determination that thefirst physical location stores less than all of the logical group ofdata requested by the read command, the management module is alsoconfigured to identify a second physical location in the storage devicebased on information contained within data from the first physicallocation.

(A20) In yet another aspect, a non-transitory computer readable storagemedium stores one or more programs for execution by one or moreprocessors (e.g., in one or more storage controllers of a storage deviceor system), the one or more programs including instructions forperforming the method of any of A1-A18.

(A21) Some embodiments include an electronic system or device (e.g.,data storage device 120, data storage system 100, or storage controller124, FIG. 1), comprising: one or more processors; and memory storing oneor more programs to be executed by the one or more processors, the oneor more programs comprising instructions for performing or controllingperformance of any of the methods described herein. Some embodimentsinclude a non-transitory computer readable storage medium, storing oneor more programs for execution by one or more processors of anelectronic system or device (e.g., data storage device 120, FIG. 1 orstorage controller 124, FIG. 1), the one or more programs includinginstructions for performing or controlling performance of any of themethods described herein. Some embodiments include an electronic systemor device (e.g., data storage device 120, FIG. 1 or storage controller124, FIG. 1) comprising means for performing or controlling performanceof the operations of any of the methods described herein.

Numerous details are described herein in order to provide a thoroughunderstanding of the example implementations illustrated in theaccompanying drawings. However, some embodiments may be practicedwithout many of the specific details, and the scope of the claims isonly limited by those features and aspects specifically recited in theclaims. Furthermore, well-known methods, components, and circuits havenot been described in exhaustive detail so as not to unnecessarilyobscure more pertinent aspects of the implementations described herein.

FIG. 1 is a block diagram illustrating an implementation of a datastorage system 100, in accordance with some embodiments. While someexample features are illustrated, various other features have not beenillustrated for the sake of brevity and so as not to obscure pertinentaspects of the example embodiments disclosed herein. To that end, as anon-limiting example, data storage system 100 includes a storage device120, which includes a storage controller 124 and one or more memorychannels 150 that each include one or more NVM devices 140 andoptionally include a respective NVM controller 130, where data storagesystem 100 is used in conjunction with or includes a computer system110. In some embodiments, NVM devices 140 for a single memory channel150 comprise a single flash memory device while in other embodiments NVMdevices 140 for a single memory channel 150 include a plurality of flashmemory devices. In some embodiments, NVM devices 140 are NAND-type flashmemory or NOR-type flash memory. In some embodiments, NVM devices 140include one or more three-dimensional (3D) memory devices, as furtherdefined herein. Further, in some embodiments, storage controller 124 isa solid-state drive (SSD) controller. However, other types of storagemedia may be included in accordance with aspects of a wide variety ofembodiments (e.g., PCRAM, ReRAM, STT-RAM, etc.). In some embodiments, aflash memory device includes one or more flash memory die, one or moreflash memory packages, one or more flash memory channels or the like. Insome embodiments, data storage system 100 can contain one or morestorage devices 120.

Computer system 110 is coupled to storage controller 124 through dataconnections 101, and optionally through a control line or bus 111 aswell. However, in some embodiments computer system 110 includes storagecontroller 124, or a portion of storage controller 124, as a componentand/or a subsystem. For example, in some embodiments, some or all of thefunctionality of storage controller 124 is implemented by softwareexecuted on computer system 110. Computer system 110 may be any suitablecomputer device, such as a computer, a laptop computer, a tablet device,a netbook, an internet kiosk, a personal digital assistant, a mobilephone, a smart phone, a gaming device, a computer server, or any othercomputing device. Computer system 110 is sometimes called a host, hostsystem, client, or client system. In some embodiments, computer system110 is a server system, such as a server system in a data center. Insome embodiments, computer system 110 includes one or more processors,one or more types of memory, a display and/or other user interfacecomponents such as a keyboard, a touch screen display, a mouse, atrack-pad, a digital camera and/or any number of supplemental devices toadd functionality. In some embodiments, computer system 110 does nothave a display and other user interface components.

In some implementations, storage device 120 includes NVM devices 140such as flash memory devices (e.g., NVM devices 140-1 through 140-n).The NVM devices of storage device 120 are sometimes collectively calleda storage medium. In some embodiments storage device 120 includes NVMcontrollers (e.g., NVM controllers 130, sometimes called memory channelcontrollers or port controllers) coupled between storage controller 124and NVM devices 140. Viewed another way, in the aforementionedembodiments, storage device 120 includes m memory channels (e.g., memorychannels 150-1 through 150-m), each of which has an NVM controller 130and a set of NVM devices 140 coupled to the NVM controller for thatmemory channel, where m is an integer greater than one. However, in someembodiments, two or more memory channels share an NVM controller.Typically, each memory channel 150 has its own distinct set of one ormore NVM devices 140. Alternatively, in some embodiments, storage device120 does not include any NVM controllers 130, and instead storagecontroller 124 handles functions such as host command parsing andlogical to physical address translation, and also manages the NVMdevices 140 in all the memory channels 150-1 to 150-m, includingdistributing individual memory operations (e.g. read, write, and erase)commands to the NVM devices 140 in the various memory channels. In anon-limiting example, the number of memory channels in a typical storagedevice is 8, 16 or 32. In another non-limiting example, the number ofNVM devices 140 per memory channel is typically 8, 16, 32 or 64.Furthermore, in some implementations, the number of NVM devices 140 isdifferent in different memory channels.

Memory channels 150 are coupled to storage controller 124 throughconnections 103. Connections 103 are sometimes called data connections,but typically convey commands in addition to data, and optionally conveymetadata, error correction information and/or other information inaddition to data values to be stored in NVM devices 140 and data valuesread from NVM devices 140. In some embodiments, however, storagecontroller 124 and NVM devices 140 are included in the same device(i.e., an integral device) as components thereof. Furthermore, in someembodiments, storage controller 124 and NVM devices 140 are embedded ina host device (e.g., computer system 110), such as a mobile device,tablet, other computer or computer controlled device, and the methodsdescribed herein are performed, at least in part, by the embedded memorycontroller.

Flash memory device(s) (e.g., NVM devices 140) can be configured forenterprise storage suitable for applications such as cloud computing,for database applications, primary and/or secondary storage, or forcaching data stored (or to be stored) in secondary storage, such as harddisk drives. Additionally and/or alternatively, flash memory device(s)can also be configured for relatively smaller-scale applications such aspersonal flash drives or hard-disk replacements for personal, laptop,and tablet computers.

NVM devices 140 are divided into a number of addressable andindividually selectable blocks. In some embodiments, the individuallyselectable blocks are the minimum size erasable units in a flash memorydevice. In other words, each block contains the minimum number of memorycells that can be erased simultaneously. Each block is usually furtherdivided into a plurality of pages and/or word lines, where each page orword line is typically an instance of the smallest individuallyaccessible (readable) portion in a block. In some embodiments (e.g.,using some types of flash memory), the smallest individually accessibleunit of a data set, however, is a sector, which is a subunit of a page.That is, a block includes a plurality of pages, each page contains aplurality of sectors, and each sector is the minimum unit of data forreading data from the flash memory device. The number of pages includedin each block varies from one implementation to another; examples are64, 128 and 256 pages, but other numbers of pages per block are suitablein some implementations.

As noted above, while data storage densities of non-volatilesemiconductor memory devices are generally increasing, a drawback ofincreasing storage density is that the stored data is more prone tobeing stored and/or read erroneously. In some embodiments, error controlcoding can be utilized to limit the number of uncorrectable errors thatare introduced by electrical fluctuations, defects in the storagemedium, operating conditions, device history, write-read circuitry,etc., or a combination of these and various other factors.

In some embodiments, storage controller 124 includes a management module121, a host interface 129, a storage medium I/O interface 128, and errorcontrol module 125. Storage controller 124 may include variousadditional features that have not been illustrated for the sake ofbrevity and so as not to obscure pertinent features of the exampleembodiments disclosed herein, and a different arrangement of featuresmay be possible. Host interface 129 provides an interface to computersystem 110 through data connections 101. Similarly, storage medium I/O128 provides an interface to memory channels 150 and respective NVMdevices 140 though connections 103. In some embodiments, storage mediuminterface I/O 128 includes transmit and receive circuitry, includingcircuitry capable of providing data, commands and configuration settingsto NVM controllers 130 (e.g., reading threshold voltages for NAND-typeflash memory).

In some embodiments, management module 121 includes one or moreprocessing units (CPUs, also sometimes called processors) 122 configuredto execute instructions in one or more programs (e.g., in managementmodule 121). In some embodiments, the one or more CPUs 122 are shared byone or more components within, and in some cases, beyond the function ofstorage controller 124. Management module 121 is coupled to hostinterface 129, error control module 125 and storage medium I/O 128 inorder to coordinate the operation of these components. In someembodiments, one or more modules of management module 121 areimplemented in a management module of computer system 110 (not shown).In some embodiments, one or more processors of computer system 110 (notshown) are configured to execute instructions in one or more programs(e.g., in a management module of computer system 110).

Error control module 125 is coupled to storage medium I/O 128, hostinterface 129, and management module 121. As an example, error controlmodule 125 is used to limit the number of uncorrectable errorsinadvertently introduced into data during writes to memory or reads frommemory. In some embodiments, error control module 125 is executed insoftware by the one or more CPUs 122 of management module 121, and, inother embodiments, error control module 125 is implemented in whole orin part using special purpose circuitry (e.g., to perform encoding anddecoding functions). In some embodiments, error control module 125 isimplemented in whole or in part by software executed on computer system110.

In some embodiments, error control module 125 includes encoder 126 anddecoder 127. In some embodiments, encoder 126 encodes data by applyingan error control code to produce a codeword, which is subsequentlystored in one or more NVM devices 140 of one or more memory channels150. Codewords produced by the encoder include both data (sometimesherein called the encoded data) and corresponding error correction bits(sometimes called parity values, parity bits, or syndrome values).Furthermore, as described in greater detail below, encoders can beconfigured to produce codewords having a particular code rate (e.g.,ratio of data bits in a codeword to the size of the codeword) andcodeword structure (e.g., length, in bits, of the codeword; optionally,the codeword structure also includes information about where, within thecodeword, the error correction bits are located). When the encoded data(e.g., one or more codewords) is read from NVM devices 140, the decoderapplies a decoding process to the encoded data to recover the data, andto correct errors in the recovered data within the error correctingcapability of the error control code.

Types of error correction codes include, for example, Hamming,Reed-Solomon (RS), Bose Chaudhuri Hocquenghem (BCH), and low-densityparity-check (LDPC). Those skilled in the art will appreciate thatvarious error control codes have different error detection andcorrection capacities, and that particular codes are selected forvarious applications for reasons beyond the scope of this disclosure. Assuch, an exhaustive review of the various types of error control codesis not provided herein. Moreover, those skilled in the art willappreciate that each type or family of error control codes may haveencoding and decoding algorithms that are particular to the type, class,or family of error control codes. On the other hand, some algorithms maybe utilized at least to some extent in the decoding of a number ofdifferent types or families of error control codes. As such, for thesake of brevity, an exhaustive description of the various types ofencoding and decoding algorithms generally available and known to thoseskilled in the art is not provided herein.

In some embodiments, encoder 126 includes a plurality of encodersconfigured to encode data in accordance with one or more errorcorrection formats (e.g., corresponding to a particular code rate,codeword structure, and error correction type, as described in greaterdetail below), and decoder 127 includes a plurality of decodersconfigured to decode data in accordance with one or more errorcorrection formats. Furthermore, in some implementations, each of theplurality of encoders and/or decoders are configured to encode/decodedata in accordance with distinct error correction formats (e.g., encoder126 includes a BCH encoder and an LDPC encoder).

Error control module 125 optionally includes a soft informationgeneration module (not shown) that is configured to provide softinformation to one or more decoders of decoder 127. Typically, a softinformation generation module converts the decoding result of a decoderinto soft information. In some implementations, the soft informationincludes at least one of conditional probabilities (i.e., transitionprobabilities) associated with the codeword and log-likelihood ratios(LLRs) associated with the codeword.

As would be known to those skilled in the art, for many error controlcodes, the decoding process can often be improved by using softinformation. Hard information decoding generally means that absolutedecisions are made as to whether a data value (e.g., data-bit orcode-bit) is one symbol or another in a particular symbol alphabet. Forexample, in a binary system, a particular data value can be either “0”or “1”, even if the raw electrical analog value read from a storagelocation does not indicate that the electrical value representing thedata value is sufficient to decide with certainty that the data value is“0” or “1.” In other words, a hard-decision for a particular data valueis based on the most likely symbol corresponding to the analogelectrical value read from the non-volatile memory devices, and theprobabilities that alternative decisions exist are ignored by thehard-decision process. Often the hard-decision is based on the Euclidiandistances from the analog read value to electrical level(s) defining thesymbols. By contrast, in the context of memory systems, the use of softinformation is based on the probabilities that different outcomes existin view of what is read from the storage medium.

In some embodiments, during a write operation, storage controller 124(e.g., specifically, host interface 129) receives from computer system(host) 110 data to be stored in one or more NVM devices 140, in additionto one or more host write commands for storing the data. In accordancewith the one or more host write commands, the data received by storagecontroller 124 is made available to an encoder (e.g., encoder 126),which encodes the data to produce one or more codewords. The one or morecodewords are made available to storage medium I/O 128, which transfersthe one or more codewords to one or more memory channels 150 for storagein one or more NVM devices 140, in a manner dependent on the type ofstorage medium being utilized.

In some embodiments, a read operation is initiated when computer system110 sends one or more host read commands to storage controller 124(e.g., specifically, to host interface 129 via data connections 101, oralternatively a separate control line or bus 111) requesting data fromNVM devices 140. Storage controller 124 sends one or more read accesscommands to NVM device 140, via storage medium I/O 128, to obtain rawread data in accordance with memory locations (physical addresses),specified, directly or indirectly, by the one or more host readcommands. Storage medium I/O 128 provides the raw read data (e.g.,comprising one or more codewords) to a decoder (e.g., decoder 127). Ifthe decoding is successful, the decoded data is provided to hostinterface 129, where the decoded data is made available to computersystem 110. In some embodiments, if the decoding is not successful,storage controller 124 may resort to a number of remedial actions orprovide an indication of an irresolvable error condition.

As explained above, NVM devices 140 are divided into a number ofaddressable and individually selectable blocks and each block isoptionally (but typically) further divided into a plurality of pagesand/or word lines and/or sectors. While erasure of non-volatile memorydevices is performed on a block basis, in many embodiments, reading andprogramming of non-volatile memory devices is performed on a smallersubunit of a block (e.g., on a page basis, word line basis, or sectorbasis). In some embodiments, the smaller subunit of a block consists ofmultiple memory cells (e.g., single-level cells or multi-level cells).In some embodiments, programming is performed on an entire page. In someembodiments, a multi-level cell (MLC) NAND flash typically has fourpossible states per cell, yielding two bits of information per cell.Further, in some embodiments, a MLC NAND has two page types: (1) a lowerpage (sometimes called the fast page), and (2) an upper page (sometimescalled the slow page). In some embodiments, a triple-level cell (TLC)NAND flash has eight possible states per cell, yielding three bits ofinformation per cell. Although the description herein uses TLC, MLC, andSLC as examples, those skilled in the art will appreciate that theembodiments described herein may be extended to memory cells that havemore than eight possible states per cell, yielding more than three bitsof information per cell.

The encoding format of the storage media (i.e., TLC, MLC, or SLC and/ora chosen data redundancy mechanism) is a choice made when data isactually written to the storage media. Often in this specification thereis described an event, condition, or process that is said to set theencoding format, alter the encoding format of the storage media, etc. Itshould be recognized that the actual process may involve multiple steps,e.g., erasure of the previous contents of the storage media followed bydata being written using the new encoding format and that theseoperations may be separated in time from the initiating event, conditionor procedure.

As an example, if data is written to non-volatile memory devices inpages, but the non-volatile memory devices are erased in blocks, pagesin the non-volatile memory devices may contain invalid (e.g., stale)data, but those pages cannot be overwritten until the whole blockcontaining those pages is erased. In order to write to the pages withinvalid data, the pages (if any) with valid data in that block are readand re-written to a new block and the old block is erased (or put on aqueue for erasing). This process is called garbage collection. Aftergarbage collection, the new block contains the pages with valid data andmay have free pages that are available for new data to be written, andthe old block can be erased so as to be available for new data to bewritten. Since flash memory can only be programmed and erased a limitednumber of times, the efficiency of the algorithm used to pick the nextblock(s) to re-write and erase has a significant impact on the lifetimeand reliability of flash-based storage systems.

FIG. 2 is a block diagram illustrating an implementation of a managementmodule 121, in accordance with some embodiments. Management module 121typically includes one or more CPUs 122 (also sometimes calledprocessors, hardware processors, processing units, microprocessors ormicrocontrollers) for executing modules, programs and/or instructionsstored in memory 206 and thereby performing processing operations,memory 206, and one or more communication buses 208 for interconnectingthese components. Communication buses 208 optionally include circuitry(sometimes called a chipset) that interconnects and controlscommunications between system components. Memory 206 includes high-speedrandom access memory, such as DRAM, SRAM, DDR RAM or other random accesssolid state memory devices, and may include non-volatile memory, such asone or more magnetic disk storage devices, optical disk storage devices,flash memory devices, or other non-volatile solid state storage devices.Memory 206 optionally includes one or more storage devices remotelylocated from CPUs 122. Memory 206, or alternately the non-volatilememory device(s) within memory 206, comprises a non-transitory computerreadable storage medium. In some embodiments, memory 206, or thecomputer readable storage medium of memory 206 stores the followingprograms, modules, and data structures, or a subset thereof:

-   -   a memory operation module 210 for dispatching commands        corresponding to read, write and/or erase operations for reading        data from, writing data to, or erasing data from NVM devices        140; in some implementations memory operation module 210        dispatches commands to NVM controllers 130, which in turn        dispatch the commands to NVM devices 140; the memory operation        module 210 including:        -   a read module 212 for performing read operations, including            identifying (e.g., from mapping table 216, headers 408 (FIG.            4B), etc.) physical locations in the storage device            corresponding to logical addresses (e.g., of logical groups            of data), and reading data from the identified physical            locations; and        -   a write module 214 for performing write operations,            including determining whether a remaining capacity of a            physical memory portion (e.g., physical page 402-1, FIG. 4B)            satisfies (e.g., is less than, or is greater than or equal            to) a threshold capacity; storing data for one or more            logical portions of respective logical groups of data (e.g.,            a head and/or tail logical portion) in one or more physical            locations in the storage device, and storing information            (e.g., in mapping table 216, headers 408 (FIG. 4B), etc.)            specifying one or more physical locations corresponding to            data for respective logical groups of data;    -   mapping table(s) 216 (sometimes referred to as “forward        translation tables”) for mapping logical addresses (e.g., of        logical groups of data) to physical addresses (e.g., physical        locations in physical memory portions); and    -   an error correction code (ECC) adjustment module 218 for        maintaining, defining, and modifying error correction formats        (e.g., modifying code rate, codeword structure, and/or error        correction type) for memory portions of non-volatile memory,        wherein modifying an error correction format is optionally in        accordance with a measured performance metric (e.g., a bit-error        rate) for a respective memory portion.

Each of the above identified elements (e.g., modules 210, 212, 214, 218,and mapping table 216) may be stored in one or more of the previouslymentioned memory devices (e.g., the devices that comprise memory 206 ofmanagement module 121), and corresponds to a set of instructions forperforming a function described above. The above identified modules orprograms (i.e., sets of instructions) need not be implemented asseparate software programs, procedures or modules, and thus varioussubsets of these modules may be combined or otherwise re-arranged invarious embodiments. In some embodiments, memory 206 may store a subsetof the modules and data structures identified above. Furthermore, memory206 may store additional modules and data structures not describedabove. In some embodiments, the programs, modules, and data structuresstored in memory 206, or the computer readable storage medium of memory206, provide instructions for implementing respective operations in themethods described below with reference to FIGS. 5A-5E.

Although FIG. 2 shows management module 121, FIG. 2 is intended more asa functional description of the various features which may be present ina management module than as a structural schematic of the embodimentsdescribed herein. In practice, and as recognized by those of ordinaryskill in the art, items shown separately could be combined and someitems could be separated. Further, although FIG. 2 shows managementmodule 121 of storage controller 124, in embodiments that include NVMcontrollers (e.g., NVM controllers 130-1 through 130-m) in storagedevice 120 (FIG. 1), some of the functions shown in FIG. 2 as beingimplemented in management module 121 may instead be implemented, inwhole or in part, in management modules (not shown) of the NVMcontrollers.

FIG. 3 illustrates codewords produced in accordance with various errorcorrection formats, in accordance with some embodiments. As will bedescribed below, an error correction format corresponds to a combinationof an error correction type, code rate, and codeword structure forencoding and decoding data in a storage system. Furthermore, whilecodewords 300 illustrate a relative proportion of data to errorcorrection bits (e.g., parity), it is understood that codewords 300 arenot necessarily drawn to scale.

As described above with respect to FIG. 1, data storage system 120 canimplement a variety of error correction schemes for encoding anddecoding data. Systems are configured to encode and decode data inaccordance with an error correction type (e.g., BCH, LDPC, etc.), whichdetermines the types of encoders, decoders, and algorithms used forencoding and decoding data. In addition, in some embodiments, datastorage system 120 is also configured to encode and decode data inaccordance with a code rate and codeword structure (e.g., codewordlength). The code rate is inversely related to the redundancy (e.g.,parity) and error correction capability of a codeword. Specifically,code rate is typically defined as a ratio of data bits in a codeword(e.g., representing host/user data) to the size of the codeword,represented mathematically as r=K/N, where the code rate r is the ratioof the data bits K to the codeword length N. Alternatively, code rate issometimes represented as the percentage (e.g., 94 percent) of codewordbits in a codeword that are data bits. As an example, an encoder thatencodes data at a code rate of 0.94 produces codewords having 94 bits ofdata for every 6 error correction bits. An equivalent metric, the ECCrate (sometimes called the parity rate), is sometimes defined as theratio of error correction bits in a codeword to the codeword length.Thus, a 6% ECC rate is equivalent to a 94% code rate. In a non-limitingexample, a typical codeword size is between 1 KB and 16 KB, inclusive,such as 2 KB or 4 KB.

An error correction type (e.g., BCH), code rate (e.g., 6% parity), andcodeword structure (e.g., codeword length) for encoding and decodingdata define a respective error correction format. An error correctionformat, given its corresponding error correction type, code rate, and/orcodeword structure, generally indicates a relative error correctioncapability (i.e., number of detectable and recoverable bits errors in acodeword) with respect to data encoded and decoded in accordance withthe error correction format. For instance, referring to the examples ofFIG. 3, the error correction format with which codeword 300-3 isproduced (e.g., LDPC algorithm, code rate 0.92) provides a higher errorcorrection capability than the error correction format with whichcodeword 300-1 (which has the same codeword length as codeword 300-3) isproduced (e.g., LDPC algorithm, code rate 0.94).

Thus, varying degrees of error correction capability (and thereforeerror correction formats) can be achieved by modifying a code rate,codeword structure, and/or an error correction type. FIG. 3 illustratescodewords 300-1 through 300-4 produced in accordance with a variety ofexample error correction formats, shown in order of increasing errorcorrection capability (from codeword 300-1 to 300-4). In someembodiments, the error correction formats used to produce codewords300-1 to 300-4 are a predefined sequence of error correction formats.FIG. 3 also shows respective percentages of data bits and errorcorrection bits of corresponding codewords, in addition to thecorresponding error correction type (e.g., codeword 300-1 produced inaccordance with a code rate of 0.94 and the LDPC algorithm).

In some cases, when transitioning from one error correction format tothe next error correction format in a predefined sequence of errorcorrection formats, only a single aspect of the error correction formatis modified (e.g., modifying only the code rate, while keeping thecodeword length the same). In other cases, when transitioning from oneparticular error correction format to the next in a predefined sequenceof error correction formats, two or more aspects of the error correctionformat are modified. In some cases, when transitioning from oneparticular error correction format to the next in a predefined sequenceof error correction formats, the codeword structure (e.g., codewordlength) is modified while maintaining the same code rate. In otherembodiments, the number of encoded data bits and the number of errorcorrection bits are not adjusted proportionally, thereby resulting in amodified code rate (e.g., in reducing the codeword length while keepingthe number of parity bits fixed, the number of data bits is reduced, andthus the code rate is reduced). In some implementations (notillustrated), when transitioning from one particular error correctionformat to the next in a predefined sequence of error correction formats,the error correction type is modified (e.g., from BCH to LDPC) whilemaintaining at least one of the other parameters of the error correctionformat (e.g., keeping the same code rate). In some cases orimplementations, modifying the code rate includes reducing the number oferror correction bits while keeping the number of data bits fixed for arespective codeword (sometimes referred to as “puncturing”). In yetother cases or implementations, modifying the code rate includesinserting bit values of zero (or alternatively, ones) into the portionof the codeword allocated for data while keeping the codeword length andthe number of error correction bits fixed, such that the code rateeffectively increases (sometimes referred to as “padding”).

Codewords to be stored in a particular physical memory portion of astorage device are encoded and decoded in accordance with a respectiveerror correction format for that particular memory portion (or for agroup of memory portions that include the particular memory portion). Amemory portion of a storage device comprises one or any combination ofmemory devices (e.g., NVM devices 140) of the storage device, or aportion of one or more memory devices (e.g., an individual erase blockof NVM device 140-1, a plurality of erase blocks of NVM device 140-1, aportion of an erase block such as all pages of a word line in NVM device140-1, etc.). Typically (although only in some embodiments), codewordsstored in many, but not all, memory portions of a storage device areinitially produced (by encoding data) and decoded in accordance with thesame error correction format (e.g., a default set of encoding/decodingparameters). Referring to data storage system 100 of FIG. 1, forexample, when storage device 120 is first placed in service, an initialdefault error correction format (e.g. BCH, with a code rate of 0.97 anda codeword size of 4 KB) is used to encode and decode data in all memoryportions of storage device 120 other than those memory portionsidentified through testing as needing a different (e.g., stronger) errorcorrection format.

However, in some embodiments, different respective error correctionformats are used for encoding data in different respective memoryportions of a storage device. Particularly, the performance ofnon-volatile memory devices (e.g., NVM devices 140-1 through 140-n)varies among the physical memory portions thereof (e.g., word lines,blocks, physical pages, etc.). An observed range of different measuredbit error rates across non-volatile memory devices, for example, may bea consequence of natural variations in quality over non-volatile memorydevices (e.g., dies, erase blocks, pages). Given the impact of suchvariations on the performance of non-volatile memory devices, in somesituations, encoding and decoding data in accordance with the same errorcorrection format for all non-volatile memory devices in a storagedevice does not optimize data redundancy (i.e., parity) and systemefficiency (e.g., number of encode and decode operations for processinga given amount of user data). That is, to satisfy predefined performancethresholds (e.g., requiring that each NVM device 140 achieves a biterror rate within or below specified thresholds), some non-volatilememory devices or physical memory portions require less error correctioncapability and some require greater error correction capability. Thus,to optimize data redundancy and system efficiency, distinct errorcorrection formats are used for respective memory portions of a storagedevice. As an example, referring to FIG. 1, data written to andretrieved from NVM device 140-1 is encoded and decoded in accordancewith a first error correction format (e.g., BCH algorithm, code rate of0.97, and codeword length of 4 KB), whereas data written to andretrieved from NVM device 140-2 is encoded and decoded in accordancewith a second error correction format (e.g., LDPC algorithm, code rateof 0.94, and codeword length of 4 KB).

As a consequence of implementing multiple or modified error correctionformats, groups of data are sometimes split and stored across multiplephysical memory portions of one or multiple non-volatile memory devices.Accordingly, as described in greater detail below, various methods areemployed for optimizing operations for reading and storing such data.

FIGS. 4A-4B represent physical and logical views of data in a storagedevice, in accordance with some embodiments.

As shown in FIGS. 4A-4B, logical groups of data (as shown in the“logical view”) are stored as codewords, which are produced by encodingthe logical groups of data (e.g., codewords 404-1 and 404-2 include userdata (UD) comprising logical group 406-1, in addition to parity bits(P), FIG. 4A). The “physical view” portion illustrates the physicallocations of the codewords (e.g., codewords 404-1 through 404-15) andthe physical memory portions (e.g., physical pages 402-1 through 402-3)to which logical groups of data correspond. For example, as shown inFIG. 4A, codewords 404-1 and 404-2 for logical group 406-1 have physicallocations corresponding to physical page 402-1 of die 400-1, which isone of a plurality of die comprising NVM device 140-1 in memory channel150-1 of FIG. 1.

Logical groups (e.g., logical groups 406-1 through 406-12), sometimesreferred to as “virtual pages,” are groups of user data, representingpredefined units of user data used by a host system for performingmemory operations (e.g., writing data to or reading data from storagedevice 120, FIG. 1). Logical groups have logical addresses (e.g.,logical addresses in a logical address space of computer system 110,FIG. 1). In some embodiments, all logical groups of data have the sameamount of user data (i.e., data excluding ECC bits) per logical group.As a non-limiting example, a logical group of data has 4 KB or 8 KB ofuser data. As shown in the physical view, logical groups of data areencoded as one or more codewords, and are stored at physical locationsof respective physical memory portions.

In some cases, logical groups of data are mapped to physical locationscorresponding to a single physical memory portion (e.g., logical group406-1 being mapped to codewords 404-1 and 404-2 in physical page 402-1,FIG. 4A). However, in other cases described below, logical groups ofdata are mapped to multiple physical locations corresponding todifferent physical memory portions (e.g., a head logical portion oflogical group 406-4 being mapped to codeword 404-5 in physical page402-1, and a tail logical portion of logical group 406-4 being mapped tocodeword 404-10 in physical page 402-2, FIG. 4B).

Particularly, in some embodiments, a given logical group of data isencoded in accordance with encoding parameters (e.g., error correctionformats specifying a code rate, a codeword structure, an errorcorrection type, etc.) specific to the physical memory portions in whichcorresponding codewords are stored. Ideally, encoding parameters (e.g.,a code rate and/or a codeword structure) and the size of logical groupsin a host system (e.g., data storage system 100) would be configuredsuch that the physical memory portions of a storage device include aninteger number of codewords corresponding to an integer number oflogical groups (e.g., a system configured such that each physical pageof a non-volatile memory device stores five codewords corresponding tofour logical groups of data). Integer correspondence between memoryportions, codewords, and logical groups would allow systems to performsingle read operations in retrieving any single logical group of data(e.g., by requiring that only one physical page be read), and permitsystems to store less metadata for indicating the corresponding physicallocations of a logical group of data (e.g., data need only specify asingle physical memory portion in which data is stored). An example ofsuch a system is shown in FIG. 4A.

However, as discussed throughout, some storage devices employ multipleor modified error correction formats when storing data in differentmemory portions of the data storage device. In these cases, integercorrespondence between memory portions, codewords, and logical groups isnot possible without sacrificing (e.g., by storing null data in) asignificant portion of the storage device's available storage space.That is, in such implementations, at least some physical memory portionsdo not store codewords for an integer number of logical groups of data,resulting in codewords for at least some logical groups of data beingsplit across distinct physical memory portions. An example of such asystem is shown in FIG. 4B, where the system implements encodingparameters at least partially distinct from those implemented in FIG.4A. In comparison to FIG. 4A, the lower code rate in FIG. 4B (i.e.,lower ratio of user data to parity bits) results in codewords containingless user data. Thus, physical memory portions are able to store datafor fewer logical groups of data, and in this case, a non-integercorrespondence arises in the number of logical groups of data perphysical memory portion. In the example shown in FIG. 4B, user data forlogical group 406-4 is contained within codewords 404-5 and 404-10,respectively located in distinct physical pages 402-1 and 402-2. Thesedistinct logical portions of a given logical group of data are sometimesreferred to as a “head” logical portion (e.g., portion of logical group406-4 corresponding to codeword 404-5) and a “tail” logical portion(e.g., portion of logical group 406-4 corresponding to codeword 404-10).Consequently, in such systems, information specifying the mappedphysical locations and physical memory portions for logical groups ofdata is stored during (or more generally, in conjunction with) theexecution of write operations, and can subsequently be used in executingread operations for quickly retrieving requested data.

The one or more physical locations (and corresponding memory portions)in a storage device to which logical groups of data are mapped andstored (e.g., as codewords) may be specified and identified in a varietyof ways. In some embodiments, one or more mapping tables (e.g., mappingtable 216 of memory 206, FIG. 2) include one or more entries specifyingmapping information that indicates the physical locations in memory towhich the logical groups of data are mapped (e.g., codeword identifier,codeword offset, offset based on units of memory, physical memoryportion identifier, etc.). When a logical group of data is mapped to twophysical locations having distinct physical memory portions, acorresponding entry of a mapping table in some cases specifies bothphysical locations (e.g., for logical group 406-8, an entry of a mappingtable specifies codeword 404-10 in physical page 402-2, and specifiescodeword 404-15 in physical page 402-3). In other implementations,however, the mapping table only specifies a single physical location(e.g., specifying codeword 404-10 in physical page 402-2), andinformation specifying the other physical location is stored separatelyfrom the mapping table (e.g., as data in a header segment). As anexample, referring to FIG. 4B, user data for logical group 406-4 isencoded into codewords 404-5 and 404-10. Here, the physical location ofcodeword 404-5 (e.g., specified as an offset of four codewords inphysical page 402-1) is stored in an entry of a mapping table (e.g.,mapping table 216 of memory 206, FIG. 2), while the physical location ofcodeword 404-10 (e.g., specified as an offset of four codewords inphysical page 402-2) is separately stored as data in header 408-1. Inthis example, the storage device first identifies the physical locationof codeword 404-5 from the mapping table, and after reading (anddecoding) codeword 404-5, identifies the physical location of andsubsequently retrieves codeword 404-10.

Methods for executing read and write operations for logical groups ofdata in accordance with various encoding and decoding parameters aredescribed in greater detail below with respect to FIGS. 5A-5E. Thevarious implementations described provide efficient and effectivemethods for storing and locating logical groups of data given anyvariety of possible error correction formats employed by a storagedevice.

FIGS. 5A-5E illustrate a flowchart representation of a method 500 ofreading data stored in a non-volatile memory device, in accordance withsome embodiments. Method 500 coordinates and manages multiple sub-systemcomponents of a storage device to execute read commands for retrievingdata from a storage device. At least in some implementations, one ormore steps of method 500 are performed by a storage device (e.g.,storage device 120, FIG. 1) or one or more components of the storagedevice (e.g., storage controller 124, management module 121, errorcontrol module 125, and/or NVM controllers 130, FIG. 1). In someembodiments, method 500 is governed by instructions that are stored in anon-transitory computer readable storage medium and that are executed byone or more processors of a device, such as the one or more processors122 of management module 121 (FIG. 2) in storage controller 124, and/orthe one or more processors of NVM controllers 130 (not shown).

A non-volatile storage device (e.g., storage device 120, FIG. 1) has(502) a plurality of physical memory portions having a predefinedsequence of physical locations in one or more non-volatile memory (NVM)devices of the storage device. An example is illustrated in FIG. 4A,where physical pages 402-1 through 402-3 are physical memory portionshaving sequential physical locations in die 400-1. In some embodiments,each of the plurality of physical memory portions comprises (504) arespective integer number of codewords arranged in a respective sequence(e.g., physical page 402-1 comprising codewords 404-1 through 404-5arranged in a sequence, FIG. 4A).

The storage device (e.g., storage device 120, FIG. 1) executes (506) aplurality of read commands, each read command of the plurality of readcommands for reading a requested logical group of data from a specifiedlogical address, the requested logical group of data comprising one ormore logical portions. As described with respect to FIG. 1, a hostsystem (e.g., computer system 110) sends one or more host read commandsto storage controller 124 requesting a logical group of data from thestorage device (e.g., from NVM devices 140 of memory channels 150).

Executing the plurality of read commands includes, for each of theplurality of read commands, identifying (5508), from a mapping table, afirst physical location in the storage device corresponding to thelogical address specified by the read command. The mapping table (e.g.,stored as mapping table 216 in memory 206, FIG. 2) includes one or moreentries that specify one or more physical locations in physical memoryportions of the storage device at which data for a requested logicalgroup of data is stored (e.g., physical locations of codewords thatcontain user data for a requested logical group of data). In someimplementations, physical locations are specified as offsets within arespective physical memory portion (e.g., offset based on number ofcodewords, units of memory, etc., measured from the beginning of arespective physical memory portion) at which data for the requestedlogical group of data is stored. In some implementations, physicallocations specify a respective memory address or range of memoryaddresses within a respective physical memory portion. As described ingreater detail below, entries of the mapping table sometimes includealternative and/or optional data for identifying physical locations forcorresponding logical groups of data having multiple logical portions(e.g., flags, physical location of header segments, etc.).

In some circumstances, the first physical location corresponds to datafor the entire requested logical group of data, and corresponds to asingle physical memory portion of the plurality of physical memoryportions (e.g., the first physical location corresponds to codewords404-6 and 406-7 in physical page 402-2, which include all the user datafor logical group 406-5, FIG. 4A). In some other circumstances, thefirst physical location corresponds (510) to data for a head logicalportion of the one or more logical portions of the requested logicalgroup of data, and thus corresponds to a first physical memory portionof the plurality of physical memory portions. For example, referring toFIG. 4B, the head logical portion of logical group 406-4 has a physicallocation corresponding to codeword 404-5 in physical page 402-1, while atail logical portion of logical group 406-4 (described in greater detailbelow) has a physical location corresponding to a different codeword ina different physical page (e.g., codeword 404-10 in physical page402-1).

In some embodiments, the first physical memory portion is (512) a firstphysical page of the storage device (e.g., physical page 402-1 of NVM140-1, FIGS. 1 and 4A). In some embodiments, the first physical memoryportion is (514) a physical memory portion of a first die (e.g.,physical page 402-1, of die 400-1, FIG. 4A).

In some embodiments, the first physical location corresponds (516) to asubset of codewords, of respective codewords for the first physicalmemory portion, located at the end of the respective sequence (e.g., forlogical group 406-4, the first physical location corresponds to theoffset for codeword 404-5, FIG. 4A). In some implementations, the subsetof codewords comprises one or a plurality of codewords, depending on thecircumstance.

Executing the plurality of read commands includes, for each of theplurality of read commands, reading (518) data from the first physicallocation in the storage device corresponding to the logical address. Insome implementations, data is read (520) from the first physical memoryportion (to which the first physical location corresponds). As anexample, after identifying the physical location of logical group 406-4in FIG. 4A (e.g., codeword 404-5 in physical page 402-1 of die 400-1),storage medium I/O 128 (FIG. 1) retrieves all (or a subset of all)codewords stored in physical page 402-1, and provides the one or morecodewords to decoder 127 for subsequent decoding.

Referring now to FIG. 5B, in some embodiments, executing the pluralityof read commands includes, for each of the plurality of read commands,determining (522) whether the first physical location stores less thanall of the requested logical group of data. In other words, adetermination is made whether the first identified physical location(step 508, FIG. 5A) corresponds to only a portion of the data for therequested logical group of data (i.e., data for only one of multiplelogical portions), while the remaining data for the requested logicalgroup of data is stored in a different physical location of a distinctphysical memory portion.

In some embodiments, determining whether the first physical locationstores less than all of the requested logical group of data includesreading (524) a corresponding entry of the mapping table (e.g., mappingtable 216, FIG. 2) for the requested logical group of data, thecorresponding entry indicating whether the first physical locationstores less than all of the requested logical group of data. In someimplementations, the corresponding entry in the mapping table includes aflag (e.g., a binary value in a designated field) indicating whether thefirst physical location (i.e., data stored in the first physicallocation) includes information specifying a second physical location. Asa non-limiting example, referring to FIG. 4B, an entry in the mappingtable 216 (FIG. 2) for logical group 406-4 includes data specifying thefirst physical location for the head logical portion of logical group406-4 (e.g., an offset for codeword 404-5 in physical page 402-1), andfurther includes a value in a designated field indicating that the firstphysical location (i.e., data contained within codeword 404-5) includesinformation specifying a second physical location (e.g., flag indicatesthat codeword 404-5 includes a header segment, such as header 408-1). Insome implementations, the corresponding entry of the mapping tablespecifies (528) a respective physical location at which the informationspecifying the second physical location is stored (e.g., an offset for acodeword in which a header segment is stored, the header segmentincluding data specifying the second physical location). Header segmentsand information stored within such header segments are described ingreater detail with respect to FIG. 5C.

Additionally and/or alternatively, determining that the first physicallocation stores less than all of the requested logical group of dataincludes reading the corresponding entry of the mapping table, whichspecifies the first and second physical locations corresponding to datafor the one or more logical portions of the requested logical group ofdata. The first and second physical locations correspond to distinctphysical memory portions of the plurality of physical memory portions ofthe storage device. For example, a mapping table entry for logical group406-8 specifies physical page 402-1 and an offset within physical page402-1 for codeword 404-5 (corresponding to the head logical portion), inaddition to specifying physical page 402-2 and an offset within physicalpage 402-2 for codeword 404-10 (corresponding to the tail logicalportion).

In some embodiments, determining that the first physical location storesless than all of the requested logical group of data includes decoding(530) at least a portion of the data read from the first physicallocation. In some implementations, the decoded data includes (532) theinformation specifying the second physical location in the storagedevice (e.g., header 408-1 is encoded as part of codeword 404-5, anddetermining that the requested logical group comprises multiple logicalportions corresponding to different physical memory portions includesdecoding at least a portion of codeword 404-5 that contains the encodedheader 408-1).

Alternatively, in some implementations, data read from the firstphysical location includes one or more codewords corresponding toencoded data for a portion of requested logical group of data, andfurther includes data corresponding to the information specifying thesecond physical location (e.g., a header segment that is not encoded andthat is stored separately from the codewords). In such implementations,the storage device determines that the first physical location storesless than all of the requested logical group of data by reading the datacorresponding to the information specifying the second physical location(e.g., directly reading a header segment without decoding anycodewords).

In some embodiments, determining that the first physical location storesless than all of the requested logical group of data includes comparing(534) the size of the decoded data to the size of the requested logicalgroup of data, wherein the first physical location stores less than allof the requested logical group of data if the size of the decoded datais less than the size of the requested logical group of data (e.g., userdata corresponding to logical group 406-8 that is obtained by decodingcodeword 404-10 is less than the size of logical group 406-8, FIG. 4B).Conversely, the first physical location (and thus the correspondingphysical memory portion) stores data for the entire requested logicalgroup of data if the size of the decoded data (corresponding to therequested logical group of data) is equal to (or greater than, if thedecoded data also includes user data for another logical group) the sizeof the requested logical group of data.

Referring now to FIG. 5C, in accordance with a determination that thefirst physical location in the storage device stores less than all ofthe logical group of data requested by the read command, executing theplurality of read commands includes, for each of the plurality of readcommands, identifying (538) a second physical location in the storagedevice based on information specifying the second physical location. Theinformation specifying the second physical location is contained withinthe data read from the first physical location in the storage device.Additionally and/or alternatively (as described previously), theinformation specifying the second physical location is specified in thecorresponding entry of the mapping table (e.g., mapping table 216, FIG.2).

In some embodiments, the information specifying the second physicallocation is stored (540) in a header segment (e.g., header 408-1, FIG.4B) that specifies: the first physical location for the head logicalportion and the second physical location for the tail logical portion(542) (e.g., respective offsets within respective memory portions); acheck value (544) for the logical group of data for verifying the firstand/or second physical location for the tail logical portion (e.g., acorresponding value is stored (e.g., in the mapping table) separatelyfrom and compared against the check value, where a match indicates thatthe first and/or second physical locations specified by the headersegment are accurate); and/or additional parity bits (546) for errorcorrecting decoded data for the logical group of data. Referring to FIG.4B, header 408-1 is associated with logical group 406-4 and is stored(e.g., as encoded data) in codeword 404-5. In this example, header 408-1includes information specifying the physical locations of both the headlogical portion (e.g., offset of four codewords in physical page 402-1)and the tail logical portion for logical group 406-4 (e.g., offset offour codewords in physical page 402-2). In alternative implementations,the header segment specifies the second physical location for the taillogical portion, but does not specify the first physical location forthe head logical portion (e.g., because the physical location of thehead logical portion is implied by, or easily derived from, the physicallocation of the header segment). In some embodiments, the header segmentspecifies respective lengths (e.g., data size) for the head and/or taillogical portions.

Referring now to FIG. 5D, in some embodiments, the second physicallocation corresponds (548) to data for a tail logical portion of the oneor more logical portions of the requested logical group of data, andcorresponds to a second physical memory portion of the plurality ofphysical memory portions, wherein the second physical memory portion isdistinct from the first physical memory portion. An example is shown inFIG. 4B, where respective data for the head and tail logical portions oflogical group 406-4 are stored at physical locations corresponding todistinct physical memory portions (physical pages 402-1 and 402-2,respectively).

In some embodiments, the second physical memory portion is (550) asecond physical page of the storage device (e.g., physical page 402-2,which is distinct from a first physical memory portion, such as physicalpage 402-1, FIG. 4B). In some embodiments, the first physical memoryportion and the second physical memory portion are physical memoryportions of the same die (e.g., physical pages 402-1 and 402-2 of die400-1 in FIG. 4B). In some embodiments, the second physical memoryportion is (552) a physical memory portion of a second die, distinctfrom the first die (e.g., a physical page of a die distinct from die400-1 in FIG. 4B, not shown).

In some embodiments, the second physical location corresponds (554) to asubset of codewords, of respective codewords for the second physicalmemory portion, located at the end of the respective sequence (e.g., forlogical group 406-8, the second physical location corresponds to anoffset for codeword 404-15, FIG. 4B). In some implementations, thesubset of codewords corresponding to the first physical location (516,FIG. 5A) and the subset of codewords corresponding to the secondphysical location each comprise a single codeword (e.g., for logicalgroup 406-8, the first physical location corresponds to codeword 404-10,and the second physical location corresponds to codeword 404-15). Insome implementations, the subset of codewords includes (556) encodeddata for a portion of the requested logical group of data and encodeddata for a portion of a distinct logical group of data (e.g., codeword404-15 includes encoded data for both logical group 406-12 and logicalgroup 406-8). In some embodiments, the encoded data for the portion ofthe distinct logical group of data corresponds to a head logical portionfor the distinct logical group of data (e.g., based on the exampleabove, codeword 404-15 includes encoded data for a head logical portionof logical group 406-12).

Referring now to FIG. 5E, data is read (558) from the second physicallocation in the storage device (identified in 538, FIG. 5C). In someimplementations, data is read (560) from the second physical memoryportion (to which the second physical location corresponds). As anexample, after identifying the second physical location of the taillogical portion of logical group 406-4 in FIG. 4B (e.g., codeword 404-10in physical page 402-2 of die 400-1), storage medium I/O 128 (FIG. 1)retrieves a subset (or all) of the codewords stored in physical page402-2, and provides the subset of codewords to decoder 127 for decoding.

After data is read from the first physical location (e.g., logical groupof data being a single logical portion), or from the first and secondphysical locations (e.g., logical group of data comprising a first andsecond logical portion), executing the plurality of read commandsincludes, for each of the plurality of read commands, decoding (562)(e.g., by decoder 127, FIG. 1) at least respective portions of the dataread from the first physical location and/or the second physicallocation in the storage device to produce the requested logical group ofdata.

In some embodiments, the decoding (562) includes determining (564), forrespective sets of one or more codewords, respective error correctionformats based on respective physical locations (and physical memoryportion) to which the respective sets of one or more codewordscorrespond, where the data read from the first physical location and thedata read from the second physical location comprise the respective setsof one or more codewords. As previously described, the error correctionformat indicates at least one of a corresponding code rate, a codewordstructure, and an error correction type for a respective physical memoryportion to which a respective physical location corresponds. Each of therespective sets of codewords are decoded (566) using the determinedrespective error correction format to produce the requested logicalgroup of data. In some embodiments, the respective error correctionformats are stored in (and thus obtained from) the mapping table (e.g.,in a corresponding entry of mapping table 216 in memory 206, FIG. 2).

In some embodiments, the respective error correction formats are storedin one or more tables or data structures separate from the mappingtable. For example, in some embodiments, a first table storesinformation specifying or indicating the current default errorcorrection format for each non-volatile memory device (e.g., flashmemory die), for example in a separate entry for each non-volatilememory device, and a second table stores information specifying orindicating exceptions to those default error correction format (e.g.,each entry in the second table indicates a particular physical memoryportion, such as a block or block sub-region, and the current errorcorrection format used or to be used when storing data in and readingdata from that physical memory portion. In some embodiments, the secondtable is a sparsely populated table, optionally implemented using a treestructure or hash table, and indexed by physical address. In someembodiments, a separate second table is provided for each non-volatilememory device, or for each group of non-volatile memory device (e.g.,all the non-volatile memory devices in a memory channel or all thenon-volatile memory devices in a non-volatile memory module).

In some implementations, an error correction format for a respective setof codewords corresponding to the first physical location (e.g., a headlogical portion) and an error correction format for a respective set ofcodewords corresponding to the second physical location (e.g., a taillogical portion) are the same. As an example (referring to FIG. 4B),physical pages 402-1 and 402-2 store data encoded with the same errorcorrection format such that their respective codewords (e.g., codewords404-1 through 404-5 for physical page 402-1, and codewords 404-6 through404-10 for physical page 402-2) have the same code rate, as illustratedby equivalent proportions of user data UD and parity P per codeword.Thus, the same code rate is used in decoding codewords 404-5 and 404-10for logical group 406-4. In other embodiments, an error correctionformat for a respective set of codewords corresponding to the firstphysical location (e.g., a head logical portion) and an error correctionformat for a respective set of codewords corresponding to the secondphysical location (e.g., a tail logical portion) are distinct. Inanother example (referring to FIG. 4B), physical pages 402-2 and 402-3store data encoded with distinct error correction formats, such thatcodewords 404-6 through 404-10 of physical page 402-2 are encoded withthe LDPC error correction algorithm and a code rate of 94 percent, whilecodewords 404-11 through 404-15 of physical page 402-3 are encoded withthe LDPC error correction algorithm and a code rate of 93 percent.

In yet another example (referring to FIG. 4B), physical pages 402-2 and402-3 store data encoded with distinct error correction formats, suchthat codewords 404-6 through 404-10 of physical page 402-2 are encodedwith the BCH error correction algorithm, while codewords 404-11 through404-15 of physical page 402-3 are encoded with the LDPC error correctionalgorithm. Thus, in decoding data for logical group 406-8, the BCH errorcorrection algorithm is used for decoding codeword 404-10, while theLDPC error correction algorithm is used for decoding codeword 404-15.

Furthermore, executing the plurality of read commands includes, for eachof the plurality of read commands, returning (568) the requested logicalgroup of data. For example, referring to FIG. 1, decoded datacorresponding to a requested logical group is made available to computersystem 110 by error control module 125 through host interface 129.

It should be understood that the particular order in which theoperations in FIGS. 5A-5E have been described is merely exemplary and isnot intended to indicate that the described order is the only order inwhich the operations could be performed. One of ordinary skill in theart would recognize various ways to reorder the operations describedherein.

In some implementations, with respect to any of the methods describedabove, the non-volatile memory is a single non-volatile memory device(e.g., flash memory device), while in other implementations, thenon-volatile memory includes a plurality of non-volatile memory devices(e.g., flash memory devices).

In some implementations, with respect to any of the methods describedabove, a storage device includes (1) one or more NVM devices, (2) amemory controller that includes a management module, and (3) aninterface to receive a plurality of commands, the storage deviceconfigured to perform or control performance of any of the methodsdescribed above.

It will be understood that, although the terms “first,” “second,” etc.may be used herein to describe various elements, these elements shouldnot be limited by these terms. These terms are only used to distinguishone element from another. For example, a first contact could be termed asecond contact, and, similarly, a second contact could be termed a firstcontact, which changing the meaning of the description, so long as alloccurrences of the “first contact” are renamed consistently and alloccurrences of the second contact are renamed consistently. The firstcontact and the second contact are both contacts, but they are not thesame contact.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the claims. Asused in the description of the embodiments and the appended claims, thesingular forms “a”, “an” and “the” are intended to include the pluralforms as well, unless the context clearly indicates otherwise. It willalso be understood that the term “and/or” as used herein refers to andencompasses any and all possible combinations of one or more of theassociated listed items. It will be further understood that the terms“comprises” and/or “comprising,” when used in this specification,specify the presence of stated features, integers, steps, operations,elements, and/or components, but do not preclude the presence oraddition of one or more other features, integers, steps, operations,elements, components, and/or groups thereof.

As used herein, the term “if” may be construed to mean “when” or “upon”or “in response to determining” or “in accordance with a determination”or “in response to detecting,” that a stated condition precedent istrue, depending on the context. Similarly, the phrase “if it isdetermined [that a stated condition precedent is true]” or “if [a statedcondition precedent is true]” or “when [a stated condition precedent istrue]” may be construed to mean “upon determining” or “in response todetermining” or “in accordance with a determination” or “upon detecting”or “in response to detecting” that the stated condition precedent istrue, depending on the context.

The foregoing description, for purpose of explanation, has beendescribed with reference to specific implementations. However, theillustrative discussions above are not intended to be exhaustive or tolimit the claims to the precise forms disclosed. Many modifications andvariations are possible in view of the above teachings. Theimplementations were chosen and described in order to best explainprinciples of operation and practical applications, to thereby enableothers skilled in the art.

What is claimed is:
 1. A method for reading data stored in anon-volatile storage device having a plurality of physical memoryportions having a predefined sequence of physical locations in one ormore non-volatile memory (NVM) devices of the storage device, the methodcomprising: executing a plurality of read commands, each read command ofthe plurality of read commands for reading a requested logical group ofdata from a specified logical address, the requested logical group ofdata comprising one or more logical portions, the executing including,for each read command of the plurality of read commands: identifying,from a mapping table, a first physical location in the storage devicecorresponding to the logical address specified by the read command;reading data from the first physical location in the storage devicecorresponding to the logical address; in accordance with a determinationthat the first physical location in the storage device stores less thanall of the logical group of data requested by the read command,identifying a second physical location in the storage device based oninformation contained within the data read from the first physicallocation in the storage device, and reading data from the secondphysical location in the storage device; decoding at least respectiveportions of the data read from the first physical location and/or thesecond physical location in the storage device to produce the requestedlogical group of data; and returning the requested logical group ofdata.
 2. The method of claim 1, wherein: the first physical locationcorresponds to data for a head logical portion of the one or morelogical portions of the requested logical group of data, and correspondsto a first physical memory portion of the plurality of physical memoryportions; the second physical location corresponds to data for a taillogical portion of the one or more logical portions of the requestedlogical group of data, and corresponds to a second physical memoryportion of the plurality of physical memory portions, wherein the secondphysical memory portion is distinct from the first physical memoryportion; reading data from the first physical location includes readingdata from the first physical memory portion; and reading data from thesecond physical location includes reading data from the second physicalmemory portion.
 3. The method of claim 1, wherein the first physicalmemory portion is a first physical page of the storage device, and thesecond physical memory portion is a second physical page of the storagedevice.
 4. The method of claim 2, wherein the first physical memoryportion is a physical memory portion of a first die, and the secondphysical memory portion is a physical memory portion of a second die,distinct from the first die.
 5. The method of claim 2, wherein the firstphysical memory portion and the second physical memory portion aredistinct physical memory portions of the same die.
 6. The method ofclaim 2, wherein: each of the plurality of physical memory portionscomprises a respective integer number of codewords arranged in arespective sequence, the first physical location corresponds to a subsetof codewords, of respective codewords for the first physical memoryportion, located at the end of the respective sequence, and the secondphysical location corresponds to a subset of codewords, of respectivecodewords for the second physical memory portion, located at the end ofthe respective sequence.
 7. The method of claim 6, wherein the subset ofcodewords corresponding to the first physical location and the subset ofcodewords corresponding to the second physical location each comprise asingle codeword.
 8. The method of claim 6, wherein the subset ofcodewords corresponding to the second physical location includes encodeddata for a portion of the requested logical group of data and encodeddata for a portion of a distinct logical group of data.
 9. The method ofclaim 8, wherein the encoded data for the portion of the distinctlogical group of data corresponds to a head logical portion for thedistinct logical group of data.
 10. The method of claim 1, furthercomprising determining whether the first physical location stores lessthan all of the requested logical group of data by reading acorresponding entry of the mapping table for the requested logical groupof data, the corresponding entry indicating that that the first physicallocation stores less than all of the requested logical group of data.11. The method of claim 10, wherein the corresponding entry includes aflag indicating whether the first physical location includes informationspecifying the second physical location.
 12. The method of claim 10,wherein the corresponding entry specifies the first and second physicallocations corresponding to data for the one or more logical portions ofthe requested logical group of data, wherein the first and secondphysical locations correspond to distinct physical memory portions ofthe plurality of physical memory portions of the storage device.
 13. Themethod of claim 10, wherein the corresponding entry specifies arespective physical location at which the information specifying thesecond physical location is stored.
 14. The method of claim 1, furthercomprising determining that the first physical location stores less thanall of the requested logical group of data by decoding at least aportion of the data read from the first physical location, wherein thedecoded data includes the information specifying the second physicallocation in the storage device.
 15. The method of claim 1, wherein thedata read from the first physical location includes one or morecodewords corresponding to encoded data for a portion of requestedlogical group of data, and further includes data corresponding to theinformation specifying the second physical location, the method furthercomprising determining that the first physical location stores less thanall of the requested logical group of data by reading the datacorresponding to the information specifying the second physicallocation.
 16. The method of claim 1, further comprising determining thatthe first physical location stores less than all of the requestedlogical group of data by: decoding at least a portion of the data readfrom the first physical location; and comparing the size of the decodeddata to the size of the requested logical group of data, wherein thefirst physical location stores less than all of the requested logicalgroup of data if the size of the decoded data is less than the size ofthe requested logical group of data.
 17. The method of claim 1, wherein:the first physical location corresponds to data for a head logicalportion of the one or more logical portions, and the second physicallocation corresponds to data for a tail logical portion of the one ormore logical portions, and the information contained within the dataread from the first physical location is stored in a header segment thatspecifies: the first physical location for the head logical portion andthe second physical location for the tail logical portion; a check valuefor the logical group of data for verifying the first and/or secondphysical location for the tail logical portion; and/or additional paritybits for error correcting decoded data for the logical group of data.18. The method of claim 1, wherein the data read from the first physicallocation and the data read from the second physical location compriserespective sets of one or more codewords, and wherein the decodingcomprises: determining, for each of the respective sets of one or morecodewords, a respective error correction format based on the respectivephysical location to which the respective set of one or more codewordscorresponds; and decoding each of the respective sets of codewords usingthe determined respective error correction format to produce therequested logical group of data.
 19. A storage device, comprising: oneor more NVM devices, wherein a plurality of physical memory portions ofthe storage device has a predefined sequence of physical locations inthe one or more NVM devices; a memory controller that includes amanagement module; an interface to receive a plurality of read commands,each read command of the plurality of read commands for reading arequested logical group of data from a specified logical address, therequested logical group of data comprising one or more logical portions;wherein the management module is configured to: identify, from a mappingtable, a first physical location in the storage device corresponding tothe specified logical addresses; and in accordance with a determinationthat the first physical location stores less than all of the logicalgroup of data requested by the read command, identify a second physicallocation in the storage device based on information contained withindata from the first physical location.
 20. A non-transitory computerreadable storage medium, storing one or more programs for execution byone or more processors of a non-volatile storage device, the storagedevice comprising a plurality of physical memory portions having apredefined sequence of physical locations in one or more NVM devices ofthe storage device, and the one or more programs including instructionsfor performing operations comprising: executing a plurality of readcommands, each read command of the plurality of read commands forreading a requested logical group of data from a specified logicaladdress, the requested logical group of data comprising one or morelogical portions, the executing including, for each read command of theplurality of read commands: identifying, from a mapping table, a firstphysical location in the storage device corresponding to the logicaladdress specified by the read command; reading data from the firstphysical location in the storage device corresponding to the logicaladdress; in accordance with a determination that the first physicallocation in the storage device stores less than all of the logical groupof data requested by the read command, identifying a second physicallocation in the storage device based on information contained within thedata read from the first physical location in the storage device, andreading data from the second physical location in the storage device;decoding at least respective portions of the data read from the firstphysical location and/or the second physical location in the storagedevice to produce the requested logical group of data; and returning therequested logical group of data.